<template>
    <div id="game">
        <p>我是game组件</p>
    </div>
</template>
<script>
import { toRefs,ref, reactive, h} from 'vue'
export default {
    props: {
        title: String
    },
    setup(props, { attrs, slots, emit }) {
        console.log(props, 'props');
        console.log(attrs, 'attrs');
        console.log(slots, 'slots');
        console.log(emit, 'emit');
        const { title } = toRefs(props);
        const readersNumber = ref(2023)
        const book = reactive({ title: '斗破苍穹' })
        //直接返回一个渲染函数render函数h(),组件的其他模板全部被替换
        return () => h('p', [title.value, book.title, readersNumber.value])
    }
}
</script>
<style lang="scss">
    
</style>